package com.company.cm.cm.cm.weather_info.generated;

import com.company.cm.cm.cm.weather_info.WeatherInfo;
import com.speedment.common.annotation.GeneratedCode;
import com.speedment.runtime.core.util.OptionalUtil;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Objects;
import java.util.Optional;
import java.util.OptionalDouble;
import java.util.OptionalLong;
import java.util.StringJoiner;

/**
 * The generated base implementation of the {@link
 * com.company.cm.cm.cm.weather_info.WeatherInfo}-interface.
 * <p>
 * This file has been automatically generated by Speedment. Any changes made to
 * it will be overwritten.
 * 
 * @author Speedment
 */
@GeneratedCode("Speedment")
public abstract class GeneratedWeatherInfoImpl implements WeatherInfo {
    
    private int id;
    private String stationNumber;
    private BigDecimal temperature;
    private String currentWeather;
    private Double windDirection;
    private Long windLevel;
    private Float pmLevel;
    private Double relaHumi;
    private BigDecimal rainCount;
    private Timestamp createTime;
    private Timestamp observationDataDate;
    private Timestamp updateTime;
    private Long deviceId;
    private Double canopyTemperature;
    
    protected GeneratedWeatherInfoImpl() {}
    
    @Override
    public int getId() {
        return id;
    }
    
    @Override
    public Optional<String> getStationNumber() {
        return Optional.ofNullable(stationNumber);
    }
    
    @Override
    public Optional<BigDecimal> getTemperature() {
        return Optional.ofNullable(temperature);
    }
    
    @Override
    public Optional<String> getCurrentWeather() {
        return Optional.ofNullable(currentWeather);
    }
    
    @Override
    public OptionalDouble getWindDirection() {
        return OptionalUtil.ofNullable(windDirection);
    }
    
    @Override
    public OptionalLong getWindLevel() {
        return OptionalUtil.ofNullable(windLevel);
    }
    
    @Override
    public Optional<Float> getPmLevel() {
        return Optional.ofNullable(pmLevel);
    }
    
    @Override
    public OptionalDouble getRelaHumi() {
        return OptionalUtil.ofNullable(relaHumi);
    }
    
    @Override
    public Optional<BigDecimal> getRainCount() {
        return Optional.ofNullable(rainCount);
    }
    
    @Override
    public Optional<Timestamp> getCreateTime() {
        return Optional.ofNullable(createTime);
    }
    
    @Override
    public Optional<Timestamp> getObservationDataDate() {
        return Optional.ofNullable(observationDataDate);
    }
    
    @Override
    public Optional<Timestamp> getUpdateTime() {
        return Optional.ofNullable(updateTime);
    }
    
    @Override
    public OptionalLong getDeviceId() {
        return OptionalUtil.ofNullable(deviceId);
    }
    
    @Override
    public OptionalDouble getCanopyTemperature() {
        return OptionalUtil.ofNullable(canopyTemperature);
    }
    
    @Override
    public WeatherInfo setId(int id) {
        this.id = id;
        return this;
    }
    
    @Override
    public WeatherInfo setStationNumber(String stationNumber) {
        this.stationNumber = stationNumber;
        return this;
    }
    
    @Override
    public WeatherInfo setTemperature(BigDecimal temperature) {
        this.temperature = temperature;
        return this;
    }
    
    @Override
    public WeatherInfo setCurrentWeather(String currentWeather) {
        this.currentWeather = currentWeather;
        return this;
    }
    
    @Override
    public WeatherInfo setWindDirection(Double windDirection) {
        this.windDirection = windDirection;
        return this;
    }
    
    @Override
    public WeatherInfo setWindLevel(Long windLevel) {
        this.windLevel = windLevel;
        return this;
    }
    
    @Override
    public WeatherInfo setPmLevel(Float pmLevel) {
        this.pmLevel = pmLevel;
        return this;
    }
    
    @Override
    public WeatherInfo setRelaHumi(Double relaHumi) {
        this.relaHumi = relaHumi;
        return this;
    }
    
    @Override
    public WeatherInfo setRainCount(BigDecimal rainCount) {
        this.rainCount = rainCount;
        return this;
    }
    
    @Override
    public WeatherInfo setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
        return this;
    }
    
    @Override
    public WeatherInfo setObservationDataDate(Timestamp observationDataDate) {
        this.observationDataDate = observationDataDate;
        return this;
    }
    
    @Override
    public WeatherInfo setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
        return this;
    }
    
    @Override
    public WeatherInfo setDeviceId(Long deviceId) {
        this.deviceId = deviceId;
        return this;
    }
    
    @Override
    public WeatherInfo setCanopyTemperature(Double canopyTemperature) {
        this.canopyTemperature = canopyTemperature;
        return this;
    }
    
    @Override
    public String toString() {
        final StringJoiner sj = new StringJoiner(", ", "{ ", " }");
        sj.add("id = "                  + Objects.toString(getId()));
        sj.add("stationNumber = "       + Objects.toString(OptionalUtil.unwrap(getStationNumber())));
        sj.add("temperature = "         + Objects.toString(OptionalUtil.unwrap(getTemperature())));
        sj.add("currentWeather = "      + Objects.toString(OptionalUtil.unwrap(getCurrentWeather())));
        sj.add("windDirection = "       + Objects.toString(OptionalUtil.unwrap(getWindDirection())));
        sj.add("windLevel = "           + Objects.toString(OptionalUtil.unwrap(getWindLevel())));
        sj.add("pmLevel = "             + Objects.toString(OptionalUtil.unwrap(getPmLevel())));
        sj.add("relaHumi = "            + Objects.toString(OptionalUtil.unwrap(getRelaHumi())));
        sj.add("rainCount = "           + Objects.toString(OptionalUtil.unwrap(getRainCount())));
        sj.add("createTime = "          + Objects.toString(OptionalUtil.unwrap(getCreateTime())));
        sj.add("observationDataDate = " + Objects.toString(OptionalUtil.unwrap(getObservationDataDate())));
        sj.add("updateTime = "          + Objects.toString(OptionalUtil.unwrap(getUpdateTime())));
        sj.add("deviceId = "            + Objects.toString(OptionalUtil.unwrap(getDeviceId())));
        sj.add("canopyTemperature = "   + Objects.toString(OptionalUtil.unwrap(getCanopyTemperature())));
        return "WeatherInfoImpl " + sj.toString();
    }
    
    @Override
    public boolean equals(Object that) {
        if (this == that) { return true; }
        if (!(that instanceof WeatherInfo)) { return false; }
        final WeatherInfo thatWeatherInfo = (WeatherInfo)that;
        if (this.getId() != thatWeatherInfo.getId()) { return false; }
        if (!Objects.equals(this.getStationNumber(), thatWeatherInfo.getStationNumber())) { return false; }
        if (!Objects.equals(this.getTemperature(), thatWeatherInfo.getTemperature())) { return false; }
        if (!Objects.equals(this.getCurrentWeather(), thatWeatherInfo.getCurrentWeather())) { return false; }
        if (!Objects.equals(this.getWindDirection(), thatWeatherInfo.getWindDirection())) { return false; }
        if (!Objects.equals(this.getWindLevel(), thatWeatherInfo.getWindLevel())) { return false; }
        if (!Objects.equals(this.getPmLevel(), thatWeatherInfo.getPmLevel())) { return false; }
        if (!Objects.equals(this.getRelaHumi(), thatWeatherInfo.getRelaHumi())) { return false; }
        if (!Objects.equals(this.getRainCount(), thatWeatherInfo.getRainCount())) { return false; }
        if (!Objects.equals(this.getCreateTime(), thatWeatherInfo.getCreateTime())) { return false; }
        if (!Objects.equals(this.getObservationDataDate(), thatWeatherInfo.getObservationDataDate())) { return false; }
        if (!Objects.equals(this.getUpdateTime(), thatWeatherInfo.getUpdateTime())) { return false; }
        if (!Objects.equals(this.getDeviceId(), thatWeatherInfo.getDeviceId())) { return false; }
        if (!Objects.equals(this.getCanopyTemperature(), thatWeatherInfo.getCanopyTemperature())) { return false; }
        return true;
    }
    
    @Override
    public int hashCode() {
        int hash = 7;
        hash = 31 * hash + Integer.hashCode(getId());
        hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getStationNumber()));
        hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getTemperature()));
        hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getCurrentWeather()));
        hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getWindDirection()));
        hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getWindLevel()));
        hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getPmLevel()));
        hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getRelaHumi()));
        hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getRainCount()));
        hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getCreateTime()));
        hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getObservationDataDate()));
        hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getUpdateTime()));
        hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getDeviceId()));
        hash = 31 * hash + Objects.hashCode(OptionalUtil.unwrap(getCanopyTemperature()));
        return hash;
    }
}